Communication device, and control method therefor

ABSTRACT

When a communication device detects another communication device operating as a providing device that provides a communication parameter and when a communication parameter has already been set between the communication device and a different communication device or when the communication device is participating in the same network as that in which the different communication device is present, the communication device transmits a session overlap notice to the detected communication device.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.13/124,203, filed Apr. 14, 2011, which is a national stage applicationof International Patent Application No. PCT/JP2009/005470 filed Oct. 20,2009, which claims the benefit of and priority to Japanese PatentApplication No. 2008-272134, filed Oct. 22, 2008, the entire contents ofeach of which are hereby incorporated by reference herein in theirentirety.

TECHNICAL FIELD

The present invention relates to a communication device and a controlmethod therefor.

BACKGROUND ART

In wireless communication such as wireless local area network (LAN)communication compatible with the Institute of Electrical andElectronics Engineers (IEEE) 802.11 standard series, a large number ofsetting items are set before use.

Examples of the setting items include communication parameters necessaryfor wireless communication, such as a service set identifier (SSID)serving as a network identifier, an encryption method, an encryptionkey, an authentication method, and an authentication key. It istime-consuming for a user to set all the parameters by manual input.

Accordingly, various vendors have developed automatic setting methodsfor easily setting communication parameters in wireless devices. In theautomatic setting methods, communication parameters are provided fromone device to another device using a procedure determined in advancebetween connected devices via messages so that the communicationparameters can be automatically set.

NPL 1 discloses Wi-Fi Protected Setup (hereinafter referred to as“WPS”), which is an industry standard protocol for automatic setting ofcommunication parameters between an access point (base station) and astation (terminal station).

In WPS, since the roles of communication parameter providing device(hereinafter referred to as “providing device”) and communicationparameter receiving device (hereinafter referred to as “receivingdevice”) are defined in advance, the transfer direction of communicationparameters is uniquely determined.

In a case where the roles of providing device and receiving device arenot defined in advance, however, it is difficult to uniquely determinethe transfer direction of communication parameters. In this case, theuser's selection of which device acts as a providing device and whichdevice acts as a receiving device may cause a problem of poor usability.

For example, it is assumed that a new device joins a network that hasalready been established between a plurality of devices. In this case,it is desirable that the new joining device act as a receiving deviceand receive communication parameters of the established network.However, since the roles of providing device and receiving device arenot defined, the new joining device may become a providing device. Inthis case, other communication parameters are provided from the devicenewly participating in the network to the participant devices of thenetwork to prevent the devices from performing communication over thenetwork they are participating in.

CITATION LIST Non Patent Literature

[NPL 1] Wi-Fi CERTIFIED™ for Wi-Fi Protected Setup: Easing the UserExperience for Home and Small Office Wi-Fi® Networks,http://www.wi-fi.org/wp/wifi-protected-setup

SUMMARY OF INVENTION

Other advantages and features of the present invention will becomeapparent from the following description taken in conjunction with thedrawings.

The present invention provides a communication device configured toperform a communication parameter setting process as a providing deviceconfigured to provide a communication parameter or a receiving deviceconfigured to receive the communication parameter provided by theproviding device. The communication device includes a search unitconfigured to search for another communication device and a setting unitconfigured to set, in a case where the search unit searches for theanother communication device, a role of the communication device to theproviding device or the receiving device based on first informationincluded in a signal transmitted from the searched-for anothercommunication device and second information stored in the communicationdevice. In a case where the communication device receives thirdinformation different from the first information and transmitted from adevice operating as a providing device, the communication device isconfigured to operate as the receiving device regardless of the secondinformation when the communication device performs the communicationparameter setting process with the device.

The present invention further provides a method of controlling acommunication device configured to perform a communication parametersetting process as a providing device configured to provide acommunication parameter or a receiving device configured to receive thecommunication parameter provided by the providing device. The methodincludes searching for another communication device and setting, in acase where the another communication device is searched for, a role ofthe communication device to the providing device or the receiving devicebased on first information included in a signal transmitted from thesearched-for another communication device and second information storedin the communication device. In a case where the communication devicereceives third information different from the first information andtransmitted from a device operating as a providing device, thecommunication device is configured to operate as the receiving deviceregardless of the second information when the communication deviceperforms the communication parameter setting process with the device.

The present invention further provides a non-transitorycomputer-readable medium storing a program for causing a computer tofunction as a communication device configured to perform a communicationparameter setting process as a providing device configured to provide acommunication parameter or a receiving device configured to receive thecommunication parameter provided by the providing device. Thecommunication device includes a search unit configured to search foranother communication device and a setting unit configured to set, in acase where the search unit searches for the another communicationdevice, a role of the communication device to the providing device orthe receiving device based on first information included in a signaltransmitted from the searched-for another communication device andsecond information stored in the communication device. In a case wherethe communication device receives third information different from thefirst information and transmitted from a device operating as a providingdevice, the communication device is configured to operate as thereceiving device regardless of the second information when thecommunication device performs the communication parameter settingprocess with the device.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of a device.

FIG. 2 is a block diagram of software function blocks in the device.

FIG. 3 is a network configuration diagram according to an embodiment ofthe present invention.

FIG. 4 is a diagram showing a first example of a sequence betweendevices according to a first embodiment of the present invention.

FIG. 5 is a diagram showing a second example of a sequence betweendevices according to the first embodiment.

FIG. 6 is a flowchart showing a role setting process for a communicationdevice according to the first embodiment.

FIG. 7 is a flowchart showing a role setting process for the acommunication device according to a second embodiment of the presentinvention.

FIG. 8 is a diagram showing a first example of a sequence betweendevices according to the second embodiment.

FIG. 9 is a diagram showing a second example of a sequence betweendevices according to the second embodiment.

DETAILED DESCRIPTION First Embodiment

A communication device according to a first embodiment of the presentinvention will now be described in detail with reference to thedrawings. In the following, a description will be given of a wirelessLAN system compatible with the IEEE 802.11 series, by way of example.However, communication other than IEEE 802.11 compatible wireless LANcommunication may be used.

A hardware configuration which is available in the present embodimentwill now be described.

FIG. 1 is a block diagram showing an example configuration of eachdevice described below according to an embodiment of the presentinvention. A device 101 includes a control unit 102 configured tocontrol the overall operation of the device 101 by executing a controlprogram stored in a storage unit 103. The control unit 102 is alsoconfigured to control communication parameter setting with respect toanother device. The storage unit 103 is configured to store the controlprogram executed by the control unit 102 and various information such ascommunication parameters. The control unit 102 executes the controlprogram stored in the storage unit 103 to perform various operationsdescribed below.

A wireless unit 104 is configured to perform wireless LAN communicationcompatible with the IEEE 802.11 series. A display unit 105 is configuredto perform various display operations, and has a function capable ofoutputting visually perceivable information, such as a liquid crystaldisplay (LCD) or light emitting diode (LED) function or capable ofoutputting sound, such as a speaker function.

A setting button 106 is configured to give a trigger for starting acommunication parameter setting process. When the setting button 106 isoperated, an automatic setting process of communication parameters isstarted. Upon detection of a user operation of the setting button 106,the control unit 102 performs the process described below.

An antenna control unit 107 is configured to control an antenna 108. Aninput unit 109 is configured to allow a user to enter various inputs.

FIG. 2 is a block diagram showing an example configuration of softwarefunction blocks for executing an operation for automatically settingcommunication parameters, which will be described below.

A device 201 includes a communication parameter automatic settingfunction block 202. In the present embodiment, the communicationparameter automatic setting function block 202 is configured toautomatically set communication parameters necessary for wireless LANcommunication, such as an SSID serving as a network identifier, anencryption method, an encryption key, an authentication method, and anauthentication key. The communication parameter automatic setting ishereinafter referred to simply as “automatic setting”.

A packet receiving unit 203 is configured to receive packets involved invarious types of communication. A beacon (notification signal) isreceived by the packet receiving unit 203. A packet transmitting unit204 is configured to transmit packets involved in various types ofcommunication. A beacon is transmitted by the packet transmitting unit204. Each beacon contains various types of information about atransmitting device thereof.

A search signal transmitting unit 205 is configured to control thetransmission of a device search signal such as a probe request. Theprobe request can also be called a network search signal for searchingfor a desired network. A probe request is transmitted by the searchsignal transmitting unit 205. A probe response which is a responsesignal to a received probe request is also transmitted by the searchsignal transmitting unit 205. In the present embodiment, when a useroperates the setting button 106 and starts the automatic settingprocess, a beacon, a probe request, and a probe response are transmittedafter an information element (IE) indicating automatic setting inprogress (the automatic setting operation is ongoing) is added to them.

A search signal receiving unit 206 is configured to control thereception of a device search signal such as a probe request from anotherdevice. A probe request is received by the search signal receiving unit206. A probe response is also received by the search signal receivingunit 206. Each of the device search signal and a response signal theretocontains various types of information about a transmitting devicethereof.

A network control unit 207 is configured to control network connection.A connection to a wireless LAN ad-hoc network or the like is implementedby the network control unit 207.

In the automatic setting function block 202, a communication parameterreceiving unit 208 is configured to receive (accept) communicationparameters from a partner device, and a communication parameterproviding unit 209 is configured to provide communication parameters toa partner device. An automatic setting control unit 210 is configured tocontrol various protocols in the automatic setting process. Theautomatic setting process described below is performed by thecommunication parameter receiving unit 208 and the communicationparameter providing unit 209 under the control of the automatic settingcontrol unit 210.

The automatic setting control unit 210 is further configured todetermine whether or not the time elapsed since the start of theautomatic setting process exceeds the time limit of the setting process.When it is determined that the elapsed time exceeds the time limit, theautomatic setting process is stopped under the control of the automaticsetting control unit 210.

A provider detecting unit 211 is configured to detect a communicationparameter providing device (hereinafter referred to as a “providingdevice”). The provider detecting unit 211 detects a providing device onthe basis of a search signal transmitted by the search signaltransmitting unit 205 and a response thereto received by the searchsignal receiving unit 206. The provider detecting unit 211 can alsodetect a providing device on the basis of a beacon received by thepacket receiving unit 203. In order to receive communication parameters,the provider detecting unit 211 requests the detected providing deviceto provide the communication parameters and receives the communicationparameters. A device that is provided with communication parameters ishereinafter referred to as a “receiving device”.

A communication parameter storage unit 212 is configured to storecommunication parameters provided from a providing device orcommunication parameters provided to a receiving device. Thecommunication parameter storage unit 212 may correspond to the storageunit 103. In the present embodiment, when communication parameters areprovided from another device, the communication parameters are stored asalready set parameters in the storage unit 103. Further, whencommunication parameters are provided to another device, thecommunication parameters are stored as already set parameters in thestorage unit 212. The already set parameters stored in the storage unit103 may be discarded at the end of the communication over the networkestablished using the already set parameters. The already set parametersmay also be discarded, after a certain period of time has elapsed sincethe parameters were stored in the storage unit 103, when the power ofthe device is turned off or at any other event.

A beacon control unit 213 is configured to control the transmissiontiming of a beacon (notification signal). A beacon generating unit 214is configured to generate a beacon. The generated beacon is transmittedto the network using the packet transmitting unit 204.

Note that all the function blocks have software or hardware correlation.Furthermore, the function blocks described above are merely examples,and a plurality of function blocks may constitute a single functionblock or some function blocks may be further divided into a plurality ofsub-blocks implementing functions.

FIG. 3 is a diagram showing a communication device A 32 (hereinafterreferred to as a “device A”), a communication device B 33 (hereinafterreferred to as a “device B”), a communication device C 34 (hereinafterreferred to as a “device C”), and an ad-hoc network A 31 (hereinafterreferred to as a “network A”). All the above devices have theconfigurations described above with reference to FIGS. 1 and 2.

It is assumed that the devices A and B have already performed theautomatic setting process therebetween and have established the networkA using communication parameters A that are shared between the devices Aand B. In the automatic setting process performed between the devices Aand B, the device A has acted as a providing device and the device B hasacted as a receiving device.

In the present embodiment, in order to allow the device C to participatein the network A, the automatic setting process is performed between thedevice A participating in the network A and the device C, by way ofexample.

Here, if the device A acts as a providing device and the device C actsas a receiving device, then the communication parameters A of thenetwork A can be provided from the device A to the device C. Thisenables the device C to participate in the network A so that the deviceC can perform data communication with the devices A and B.

FIG. 4 is a diagram showing an example of a process sequence performedwhen the automatic setting process is performed between the devices Aand C by pressing the setting buttons 106 of the devices A and C.

The device A has already established the network A with the device Busing the communication parameters A that are set in the automaticsetting process performed between the devices A and B (F401).

When the setting buttons 106 of the devices A and C are pressed, thedevice C creates a unique network C (F403). Since the device A hasalready established the network A, the device A creates no new network.

Here, the networks A and C are distinguished from each other using basicservice set identifiers (BSSIDs) serving as network identifiers. BSSIDis a random network identifier generated by a device that creates anetwork. Note that SSID is a network identifier that can be set inadvance in a device or that can be set to a desired value by a user, andis different from BSSID. Further, as can be seen from the foregoingdescription, BSSID is not a communication parameter provided from aproviding device to a receiving device in the automatic setting process.

Next, each of the devices A and C starts a process for determining whichoperation role (hereinafter referred to as “role”) of providing deviceor receiving device the device plays. First, each of the devices A and Csets the role it plays to a providing device candidate (F402, F405), andstarts a timer T1 for measuring the time limit of the providing devicesearch process (F404, F406). The term “providing device candidate”, asused herein, refers to the device state where the given device has notbeen set to either a providing device or a receiving device although thedevice can operate as a providing device.

Next, each of the devices A and C transmits a beacon (notificationsignal) including an information element indicating that the device hasan automatic setting function or is currently performing the automaticsetting process (F407, F408). Each beacon may include an informationelement indicating the current role, “providing device candidate”.

Since the beacons contain different BSSIDs for the networks A and C, adevice that has received each of the beacons can recognize which networkthe device that has transmitted the beacon belongs to.

Next, the device A transmits a search signal for searching for aproviding device (F409). Like the beacons, the search signal alsocontains an information element indicating that the transmitter of thesearch signal has an automatic setting function or is currentlyperforming the automatic setting process or an information elementindicating the current role, “providing device candidate”.

Upon receipt of the search signal transmitted from the device A, thedevice C transmits a search response signal to the device A (F410). Likethe beacons and the search signal, the search response signal alsocontains an information element indicating that the transmitter of thesearch response signal has an automatic setting function or is currentlyperforming the automatic setting process or an information elementindicating the current role, “providing device candidate”.

If the timer T1 of the device A has expired without a providing devicebeing detected (F411), the device A sets the role it plays to aproviding device (F412).

Now, the device C transmits a search signal for searching for aproviding device (F413). The search signal transmitted from the device Calso contains an information element indicating that the device C has anautomatic setting function or is currently performing the automaticsetting process or an information element indicating the current role,“providing device candidate”.

Upon receipt of the search signal transmitted from the device C, thedevice A transmits a search response signal to the device C (F414). Likethe beacons and the search signal, the search response signal containsan information element indicating that the transmitter of the searchresponse signal has an automatic setting function or is currentlyperforming the automatic setting process. Since the device A has set therole it plays to a providing device at this time, the device A includesan information element indicating a “providing device” in the searchresponse signal and transmits the search response signal. In addition tothe information element indicating the role of “providing device”, aninformation element indicating that the device A can providecommunication parameters may also be contained.

Upon receipt of the search response signal transmitted from the deviceA, the device C confirms that the device A plays the role of providingdevice and can provide communication parameters. Then, the device Cstops the timer T1 (F415), sets the role it plays to a receiving device(F416), and participates in the network A (F417).

This allows the devices A and C to transmit and receive communicationmessages (protocol messages) to be exchanged in the automatic settingprotocol process of communication parameters. Since the communicationparameters such as an encryption key and an authentication key have notbeen set in the device C when the device C participates in the network Ain F417, the device C is not allowed to perform normal datacommunication based on encryption and authentication with the device A.

The term “automatic setting protocol process”, as used herein, refers toa process for transmitting and receiving various predeterminedcommunication messages in order to provide communication parameters froma providing device to a receiving device. In WPS, this protocol processis called Registration Protocol (see NPL 1). In the present embodiment,for ease of description, the following procedures 1 to 3 will bedescribed as the automatic setting protocol process:

1. A message indicating the start of communication parameter setting(message for requesting the provision of communication parameters) istransmitted from a receiving device to a providing device.

2. In response to the message, the providing device performs a processof providing communication parameters to the receiving device.

3. When the provision of the communication parameters is completed, amessage indicating the completion of communication parameter setting istransmitted from the providing device to the receiving device.

While in the foregoing description, a providing device is searched forby performing active scan using a search signal and a search responsesignal, passive scan for searching for a providing device by waiting fora beacon to be received may be used. Alternatively, a providing devicemay be searched for using a combination of active scan and passive scan.

When the device C participates in the network A, the device C transmitsa message indicating the start of communication parameter setting to thedevice A (F418). Then, in response to the message, a providing processfor providing the communication parameters A from the device A to thedevice C is performed (F419). When the providing process is completed,the device A transmits a message indicating the completion ofcommunication parameter setting to the device C (F420). Accordingly, thecommunication parameter setting process is completed, and thecommunication parameters A are shared between the devices A and C.

Then, the devices A and C perform a communication connection processusing the shared communication parameters A (F421). The communicationconnection process may be automatically started when the communicationparameter setting process is completed, thereby facilitatingcommunication between the devices A and C without causing a user toperform an operation.

In this manner, when the device A becomes a providing device accordingto the role setting sequence, the communication parameters A areprovided to the device C. However, depending on the pressing timing ofthe setting buttons 106 of the devices A and C, the device C may becomea providing device and the device A may become a receiving device. Inthis case, communication parameters C, which are different from thecommunication parameters A, are provided from the device C to the deviceA. This enables the devices A and C to establish a new network using thecommunication parameters C but prevents the devices A and C fromcommunicating with the device B over the network A. In the presentembodiment, therefore, a process for avoiding the occurrence of such asituation will be described.

FIG. 5 is a diagram showing an example of a process sequence performedwhen the automatic setting process is performed between the devices Aand C by pressing the setting buttons 106 of the devices A and C.

The device A has already established the network A with the device Busing the communication parameters A that are set in the automaticsetting process performed between the devices A and B (F501).

When the setting button 106 of the device C is pressed here, the deviceC creates a unique network C (F502).

Then, the device C starts a process for determining which of a providingdevice and a receiving device the device C acts as. First, the device Csets itself to the providing device candidate (F503), and starts a timerT1 for measuring the time limit of the providing device search process(F504).

Then, the device C transmits a beacon (notification signal) including aninformation element indicating that the device C has an automaticsetting function or is currently performing the automatic settingprocess (F505). The beacon may include an information element indicatingthe current role, “providing device candidate”.

Subsequently, the device C transmits a search signal for searching for aproviding device (F506). Like the beacon, the search signal alsocontains an information element indicating that the device C has anautomatic setting function or is currently performing the automaticsetting process or an information element indicating the current role,“providing device candidate”.

Upon receipt of the search signal transmitted from the device C, thedevice A transmits a search response signal to the device C (F507).Since the setting button 106 of the device A has not been pressed whenthe device A receives the search signal, the device A has not startedthe automatic setting process. Thus, the device A transmits a searchresponse signal including an information element indicating that thedevice A has an automatic setting function but is not currentlyperforming the automatic setting process.

If the timer T1 of the device C has expired without a providing devicebeing detected (F508), the device C sets the role it plays to aproviding device (F509).

When the setting button 106 of the device A is pressed here, the deviceA sets itself to the providing device candidate (F510), and starts atimer T1 for measuring the time limit of the providing device searchprocess (F511).

Next, the device A transmits a beacon (notification signal) including aninformation element indicating that the device A has an automaticsetting function or is currently performing the automatic settingprocess (F512). The beacon may include an information element indicatingthe current role, “providing device candidate”.

Subsequently, the device A transmits a search signal for searching for aproviding device (F513). Like the beacon, the search signal alsocontains an information element indicating that the device A has anautomatic setting function or is currently performing the automaticsetting process or an information element indicating the current role,“providing device candidate”.

Upon receipt of the search signal transmitted from the device A, thedevice C transmits a search response signal to the device A (F514). Likethe beacon and the search signal, the search response signal alsocontains an information element indicating that the transmitter of thesearch response signal has an automatic setting function or is currentlyperforming the automatic setting process. Since the device C has set therole it plays to a providing device at this time, the device C includesan information element indicating a “providing device” in the searchresponse signal and transmits the search response signal. In addition tothe information element indicating the role of “providing device”, aninformation element indicating that the device C can providecommunication parameters may also be contained.

Upon receipt of the search response signal transmitted from the deviceC, the device A confirms that the device C plays the role of providingdevice and can provide communication parameters. Thus, the device Astops the timer T1 (F515).

If the device A sets the role it plays to a receiving device here,communication parameters C, which are different from the communicationparameters A, are provided from the device C to the device A. Thus, inorder to maintain the network A, the device A sets the role it plays toa providing device rather than a receiving device (F516).

Therefore, both the devices C and A become providing devices. Thus, thedevice A transmits a session overlap notice to the device C to notifythat a plurality of providing devices are present (F517).

Upon receipt of the session overlap notice from the device A, the deviceC determines that the device C can no longer continue acting as aproviding device, and changes the role it plays to a receiving device(F518). Then, the device C is provided with communication parametersfrom the device A, and performs a communication connection process usingthe communication parameters shared between the devices A and C (F519 toF523). The processing of F519 to F523 is similar to the processing ofF417 to F421 shown in FIG. 4, and will not be described herein.

FIG. 6 is a flowchart showing an example of the operation flow performedbetween the devices A and C.

The control executed by both devices will now be described along theflowchart.

First, a device determines whether or not the setting button 106 thereofhas been pressed for instructing start of the automatic setting process(S601). When it is determined in S601 that the setting button 106 hasbeen pressed, the device sets the role it plays to the providing devicecandidate (S602), and starts a timer T1 (S603).

Then, after setting the role to the providing device candidate, thedevice starts the transmission of a beacon including an informationelement indicating that the device has an automatic setting function oris currently performing the automatic setting process (S604). The beaconmay include an information element indicating the current role,“providing device candidate”.

Then, the device performs a providing device search process until aproviding device has been found or the timer T1 has expired (S605 toS608). Specifically, if the timer T1 has not expired in S605, the devicetransmits a search signal (probe request) (S606), and waits for a searchresponse signal (probe response) to be received (S607).

Upon receipt of a search response signal, the device refers to theinformation element in the search response signal and determines whetheror not the partner device plays the role of providing device (S608). Ifthe partner device plays the role of providing device, the device stopsthe timer T1 (S609).

When no search response signal is received in S607 or when it isdetermined in S608 that the partner device plays a role other than aproviding device on the basis of the information element in the receivedsearch response signal, the device returns to S605 and performs theprocess again.

After the timer T1 is stopped in S609, the device checks whether or notthe device has already performed the automatic setting process withanother device (S610).

The determination of whether or not the automatic setting process hasalready been performed may be performed by determining whether or notalready set parameters have been stored in the storage unit 103. Whenthe device has already performed the automatic setting process withanother device, the device sets the role it plays to a providing device(S611).

Then, the device transmits a session overlap notice to the partnerdevice (S612). After the partner device that has received the sessionoverlap notice is switched to a receiving device, the device performs aprocess of providing communication parameters to the partner device(S613).

After the session overlap notice has been transmitted, the display unit105 may perform display to prompt a user to enter an instruction as towhether or not to continue the automatic setting process so as to switchbetween continuation and termination of the automatic setting process inaccordance with the instruction entered by the user. Alternatively, whenthe session overlap notice is transmitted, the automatic setting processmay be terminated due to error.

When it is determined in S610 that the automatic setting process has notyet been performed, the device sets the role it plays to a receivingdevice (S614). Then, the device performs a process of receivingcommunication parameters provided from the partner device acting as aproviding device (S615).

When the timer T1 has expired in S605 without a providing device beingdiscovered, the device sets the role it plays to a providing device(S616). Then, after the device has set the role it plays to a providingdevice, upon receipt of a session overlap notice from another device(S617), then in S614, the device switches the role it plays to areceiving device, and is provided with communication parameters from theproviding device (the transmitter of the session overlap notice) (S615).

The device may restart the automatic setting process (resume the processfrom S602) upon receipt of a session overlap notice. In this case, theproviding device that is the transmitter of the session overlap noticeis detected in the providing device search process (S605 to S608). As aresult, the device can act as a receiving device and can be providedwith communication parameters from the providing device. Alternatively,upon receipt of a session overlap notice, the device may terminate theautomatic setting process due to error.

When no session overlap notice is received, the device performs aprocess of providing communication parameters to a device that hasstarted the operation as a receiving device (S618).

Accordingly, the present embodiment ensures that a network establishedusing communication parameters set in the previous automatic settingprocess can be maintained even when a new automatic setting process isstarted.

In the foregoing description, the device C newly participates in thenetwork A that has been established between the devices A and B, by wayof example. In some cases, the device B may be temporarily disconnectedfrom the network A due to some reasons (such as radio interference orunexpected power-off due to the user's operation error). Even in suchcases, the present embodiment allows the device A to providecommunication parameters A shared with the device B to the device C, andthe device B can be returned to the network A using the communicationparameters A.

In the foregoing description, furthermore, in order to transmit asession overlap notice to a partner device that has started theoperation as a providing device in S612, a device sets the role it playsto a providing device in S611. However, the device may not necessarilyset the role it plays to a providing device. When it is determined inS610 that the automatic setting process has already been performed, thedevice may omit the processing of S611 and may transmit a sessionoverlap notice in S612.

In the foregoing description, furthermore, a device transmits a sessionoverlap notice to a partner device acting as a providing device in orderto cause the partner device to stop the operation as a providing device.However, a session overlap notice may not necessarily be used as far aslimitations can be imposed on the operation of the partner device actingas a providing device. For example, a message for instructingtermination of the automatic setting process or a message forinstructing limitation or termination of the operation of the partnerdevice as a providing device may be used.

In the foregoing description, furthermore, the determination of whetheror not the automatic setting process has already been performed isperformed by determining in S610 as to whether or not already setparameters have been stored in the storage unit 103. However, any othermethod may be used to perform the determination. For example, a historyof the execution of the automatic setting process may be stored in thestorage unit 103, and the determination of whether or not the automaticsetting process has already been performed may be performed based on thehistory of the execution. In this case, the time (or date) when theautomatic setting process was performed may be stored as a history ofexecution, and the determination of whether or not the automatic settingprocess has already been performed may be determined in accordance withthe time elapsed since the automatic setting process was performed. Inan exemplary method, even if a history of the automatic setting processhaving been executed previously is stored, when a certain period of timehas elapsed (such as an hour later or a day later), it may be determinedthat the automatic setting process has not yet been performed.

Second Embodiment

In the first embodiment, a device that has started the automatic settingprocess is first set to the providing device candidate and performs aproviding device search process regardless of whether or not the devicehas already performed the automatic setting process with another device.

In a second embodiment of the present invention, an exemplary processusing a role setting algorithm different from that in the firstembodiment will be described. In the role setting algorithm described inthe second embodiment, a device first determines whether or not thedevice is participating in a network. When it is determined that thedevice is participating in the network, the device acts as a providingdevice without waiting for a timer T1 to expire.

The second embodiment also employs a device configuration and networkconfiguration similar to those in the first embodiment.

FIG. 8 is a diagram showing an example of a process sequence performedwhen the automatic setting process is performed between the devices Aand C by pressing the setting buttons 106 of the devices A and C.

The device A has already established the network A with the device Busing the communication parameters A that are set in the automaticsetting process performed with the device B (F801).

When the setting button 106 of the device A is pressed, the device Afirst checks whether or not the device A is participating in a network.The term “participating in a network”, as used herein, means thatanother device that holds the same BSSID as the BSSID held in a givendevice exists. For example, even when the device A has already performedthe automatic setting process and shares communication parameters A withthe device B, if the power of the device B is turned off, the device Bdoes not hold the same BSSID. In this case, it is determined that thedevice A is not participating in the network.

In the network configuration shown in FIG. 3, “the device A isparticipating in a network” means the devices A and B are present in thesame network. Therefore, when the device B is participating in a networkcreated by the device A or when the device A is participating in anetwork created by the device B, it is determined that “the device A isparticipating in a network”. When the device B is not participating in anetwork created by the device A or when the devices A and B have createddifferent networks, it is determined that “the device A is notparticipating in a network”. The determination of whether or not a givendevice is participating in a network can be performed by, for example,performing active scan and/or passive scan and determining whether ornot a device having the same BSSID as and a different MAC address fromthe given device can be discovered.

Furthermore, when, in addition to the discovery of a device having thesame BSSID as and a different MAC address from a given device, the givendevice can perform communication with the discovered device in an upperlayer, it may be determined that the given device is “participating in anetwork”. That is, even when a device having the same BSSID as and adifferent MAC address from a given device is discovered, unlesscommunication in an upper layer can be performed, it is determined thatthe given device is not “participating in a network”. For example, adevice may transmit a Ping and may determine whether or not a responsethereto can be received to determine whether or not the device isparticipating in a network.

The device A checks whether or not the device A is participating in thenetwork A, that is, whether or not the device B is present in thenetwork A (F801-2). When the device A confirms the presence of thedevice B, the device A sets the role it plays to a providing device(F802).

When the setting button 106 of the device C is pressed, the device Ccreates a unique network C (F803). Then, the device C sets itself to theproviding device candidate (F805), and starts a timer T1 (F806).

Next, each of the devices A and C transmits a beacon (notificationsignal) including an information element indicating that the device hasan automatic setting function or is currently performing the automaticsetting process (F807, F808). The device C may include an informationelement indicating the current role, “providing device candidate”, inthe beacon. The device A may include an information element indicating a“providing device” in the beacon.

Next, the device C transmits a search signal for searching for aproviding device (F813). The search signal transmitted from the device Calso contains an information element indicating that the device C has anautomatic setting function or is currently performing the automaticsetting process or an information element indicating the current role,“providing device candidate”.

Upon receipt of the search signal transmitted from the device C, thedevice A transmits a search response signal to the device C (F814). Likethe beacons and the search signal, the search response signal containsan information element indicating that the device A has an automaticsetting function or is currently performing the automatic settingprocess. Since the device A has set the role it plays to a providingdevice at this time, the device A includes an information elementindicating a “providing device” in the search response signal andtransmits the search response signal. In addition to the informationelement indicating the role of “providing device”, an informationelement indicating that the device A can provide communicationparameters may be contained.

Upon receipt of the search response signal transmitted from the deviceA, the device C confirms that the device A plays the role of providingdevice and can provide communication parameters. Thus, the device Cstops the timer T1 (F815), sets the role it plays to a receiving device(F816), and participates in the network A (F817). This allows thedevices A and C to transmit and receive communication messages to beexchanged in the automatic setting protocol process of communicationparameters. Since the communication parameters such as an encryption keyand an authentication key have not been set in the device C when thedevice C participates in the network A in F817, the device C is notallowed to perform normal data communication based on encryption andauthentication with the device A.

While in the foregoing description, a providing device is searched forby performing active scan using a search signal and a search responsesignal, passive scan for searching for a providing device by waiting fora beacon to be received may be used. Alternatively, a providing devicemay be searched for using a combination of active scan and passive scan.

When the device C participates in the network A, the device C transmitsa message indicating the start of communication parameter setting to thedevice A (F818). Then, in response to the message, a providing processfor providing the communication parameters A from the device A to thedevice C is performed (F819). When the providing process is completed,the device A transmits a message indicating the completion ofcommunication parameter setting to the device C (F820). Accordingly, thecommunication parameter setting process is completed, and thecommunication parameters A are shared between the devices A and C.

Then, the devices A and C perform a communication connection processusing the shared communication parameters A (F821).

In this manner, when the device A becomes a providing device at the timewhen it is checked that the device A is participating in a network, thedevice C is set to a receiving device, and therefore the communicationparameters A are provided to the device C. However, even if such controlis performed, depending on the pressing timing of the setting buttons106 of the devices A and C, the device C may become a providing deviceand the device A may become a receiving device. In the presentembodiment, therefore, a process for avoiding the occurrence of such asituation will be described.

FIG. 9 is a diagram showing an example of a process sequence performedwhen the automatic setting process is performed between the devices Aand C by pressing the setting buttons 106 of the devices A and C.

The device A has already established the network A with the device Busing the communication parameters A that are set in the automaticsetting process performed between the devices A and B (F901).

When the setting button 106 of the device C is pressed here, the deviceC creates a unique network C (F902).

Then, the device C sets itself to the providing device candidate (F903),and starts a timer T1 (F904)

Next, the device C transmits a beacon (notification signal) including aninformation element indicating that the device C has an automaticsetting function or is currently performing the automatic settingprocess (F905). The beacon may include an information element indicatingthe current role, “providing device candidate”.

Subsequently, the device C transmits a search signal for searching for aproviding device (F906). Like the beacon, the search signal alsocontains an information element indicating that the device C has acommunication parameter automatic setting function or is currentlyperforming the processing or an information element indicating thecurrent role, “providing device candidate”.

Upon receipt of the search signal transmitted from the device C, thedevice A transmits a search response signal to the device C (F907).Since the setting button 106 of the device A has not been pressed whenthe device A receives the search signal, the device A has not startedthe automatic setting process. Thus, the device A transmits a searchresponse signal including an information element indicating that thedevice A has an automatic setting function but is not currentlyperforming the automatic setting process.

If the timer T1 of the device C has expired without a providing devicebeing detected (F908), the device C sets the role it plays to aproviding device (F909).

When the setting button 106 of the device A is pressed here, the deviceA confirms that the device B is participating in the network A where thedevice A is participating (F910), and thereafter sets the role it playsto a providing device (F911).

When the presence of the device B cannot be confirmed, the device A setsthe role it plays to the providing device candidate. In this case, thesubsequent operation sequence is the same as or similar to thatdescribed in the first embodiment.

Next, the device A transmits a beacon (notification signal) including aninformation element indicating that the device A has an automaticsetting function or is currently performing the automatic settingprocess (F912). The beacon may include an information element indicatingthe current role, “providing device”.

Subsequently, the device A transmits a search signal to determinewhether or not another providing device is present (F913). Like thebeacon, the search signal also contains an information elementindicating that the device A has an automatic setting function or iscurrently performing the automatic setting process or an informationelement indicating the current role, “providing device”.

Upon receipt of the search signal transmitted from the device A, thedevice C transmits a search response signal to the device A (F914). Likethe beacon and the search signal, the search response signal alsocontains an information element indicating that the device C has anautomatic setting function or is currently performing the automaticsetting process. Since the device C has set the role it plays to aproviding device at this time, the device C includes an informationelement indicating a “providing device” in the search response signaland transmits the search response signal. In addition to the informationelement indicating the role of “providing device”, an informationelement indicating that the device C can provide communicationparameters may be contained.

Upon receipt of the search response signal, the device A can recognizethe presence of a providing device in addition to the device A. Thus,the device A transmits a session overlap notice to cause the device C tostop the operation as a providing device (F915).

Upon receipt of the session overlap notice from the device A, the deviceC determines that the device C can no longer continue acting as aproviding device, and changes the role it plays to a receiving device(F916). Then, the device C is provided with communication parametersfrom the device A, and performs a communication connection process usingthe communication parameters shared between the devices A and C (F917 toF921). The processing of F917 to F921 is similar to the processing ofF817 to F821 shown in FIG. 8, and will not be described herein.

FIG. 7 is a flowchart showing an example of the operation flow performedbetween the devices A and C according to the second embodiment.

The control executed by both devices will now be described along theflowchart.

First, a device determines whether or not the setting button 106 thereofhas been pressed for instructing start of the automatic setting process(S701).

When it is determined in S701 that the setting button 106 has beenoperated, the device checks whether or not the device is nowparticipating in a network (S702).

When it is determined in S702 that the device is participating in anetwork, the device sets the role it plays to a providing device toallow another new device to participate in the network (S719).

After the device is set as a providing device, the device transmits asearch signal (probe request) (S720), and waits for a search responsesignal (probe response) to be received for a certain period of time(S721). When a search response signal is received from a providingdevice in S721, there may be a possibility that the communication overthe network where the device is participating may not be maintained.Thus, the device transmits a session overlap notice to the otherproviding device (S722). Then, after the other device that has receivedthe session overlap notice is switched to a receiving device, the deviceperforms a process of providing communication parameters to the otherdevice (S723).

After the session overlap notice has been transmitted, the display unit105 may perform display to prompt a user to enter an instruction as towhether or not to continue the automatic setting process so as to switchbetween continuation and termination of the automatic setting process inaccordance with the instruction entered by the user. Alternatively, whenthe session overlap notice is transmitted, the automatic setting processmay be terminated due to error.

When a search response signal is not received from a providing device inS721, the device performs a process of providing communicationparameters to a partner device that has started the operation as areceiving device (S723).

When it is determined in S702 that the device is not participating in anetwork, the device continues a process similar to that in the firstembodiment (the process after S602 shown in FIG. 6).

Accordingly, the present embodiment can achieve advantages similar tothose in the first embodiment even with the use of a role settingalgorithm different from that in the first embodiment.

In the foregoing description, when it is determined in S702 shown inFIG. 7 that the device is not participating in a network, the processingafter S602 shown in FIG. 6 is performed. However, all the processing maynot necessarily be performed in the same manner. Modifications will nowbe described.

When it is determined in S702 that no other devices are present in thesame network, there is less need to maintain the network, and the devicemay act as a receiving device and receive new communication parametersfrom another device. Accordingly, when it is determined in S702 that noother devices are present in the same network and when a providingdevice is detected in S708, the device may set the role it plays to areceiving device regardless of whether or not the device has alreadyperformed the automatic setting process with another device. In otherwords, the determination process of S710 may be omitted and the devicemay proceed to S714.

In the foregoing description, the network A is established using thecommunication parameters A that are set in the automatic setting processperformed in advance between the devices A and B. However, the presentinvention can be applied even in a case where a network is establishedbetween the devices A and B using communication parameters set by manualinput by a user.

In this case, communication parameters set during manual setting(hereinafter as “communication parameters A′”) are stored as already setparameters in the storage unit 103. Then, in S702, it is determinedwhether or not the device is participating in a network establishedusing the communication parameters A′. When it is determined that thedevice is participating in the network, in S719, the device sets therole it plays to a providing device. In S723, the device provides thecommunication parameters A′ to the partner device. When it is determinedthat the device is not participating in the network, the processingafter S703 is performed. In S710, it is determined whether or not thecommunication parameters A′ have already been manually set. When it isdetermined that the communication parameters A′ have already beenmanually set, the device sets the role it plays to a providing device(S711), and transmits a session overlap notice to the partner device(S712). Then, in S713, the device provides the communication parametersA′ to the partner device. When communication parameters have not yetbeen manually set, the device sets the role it plays to a receivingdevice (S714), and receives communication parameters from a partnerdevice acting as a providing device (S715). Therefore, a network can beestablished by manual setting, and the network can be maintained evenwhen the automatic setting process is performed to allow a new device toparticipate in the network.

Furthermore, the determination processes of S702 and S710 may beperformed in a different manner depending on whether communicationparameters have already been set by the automatic setting process or bymanual setting. For example, in S702, regardless of which of automaticsetting or manual setting has been used to set communication parameters,it may be determined whether or not the device is participating in anetwork established using the set communication parameters. In S710, itmay be determined whether or not the communication parameters havealready been set in the automatic setting process. That is, when thecommunication parameters have already been set by manual setting, inS702, it is determined whether or not the device is participating in thenetwork established using the already set communication parameters. Whenit is determined that the device is not participating in the network,the device performs the processing after S703. Then, in thedetermination of S710, since the communication parameters have alreadybeen set by manual setting but not by automatic setting, the deviceproceeds to S714. This enables adaptive switching of the determinationof the maintenance of the network by determining which method ofautomatic setting and manual setting has been used to set thecommunication parameters. For example, when the communication parametershave already been set by the automatic setting process, othercommunication parameters can be prevented from being provided fromanother device. Further, when the communication parameters have alreadybeen set by manual setting, if another device is present in the networkestablished using the already set communication parameters, the networkcan be maintained. If no other devices are present, on the other hand,the device can be ready to receive new communication parameters fromanother different device.

Furthermore, like the first embodiment, the device sets the role itplays to a providing device in S711 in order to transmit a sessionoverlap notice in S712. However, the device may not necessarily set therole it plays to a providing device. When it is determined in S710 thatcommunication parameters have already been set, the device may omit theprocessing of S711 and may transmit a session overlap notice in S712.

Furthermore, any other message may be used as far as limitations can beimposed on the operation of a partner device acting as a providingdevice. That is, a session overlap notice may not necessarily be used.For example, a message for instructing termination of the automaticsetting process or a message for instructing limitation or terminationof the operation of the partner device as a providing device may beused.

In the foregoing description, furthermore, IEEE 802.11 compatiblewireless LAN communication is used by way of example. However, thepresent invention may also be implemented using media compatible withother wireless standards such as Wireless Universal Serial Bus (WirelessUSB), Multiband Orthogonal Frequency Division Multiplexing (OFDM)Alliance (MBOA), Bluetooth (registered trademark), Ultra Wide Band(UWB), and ZigBee. The present invention may also be implemented usingwired communication media such as a wired LAN.

UWB includes wireless USB, wireless 1394, and WINET.

Furthermore, the communication parameters include a network identifier,an encryption method, an encryption key, an authentication method, andan authentication key, byway of example. Any other information may beused, or other information may be included in communication parameters.

The present invention may be implemented by providing a storage mediumstoring program code of software implementing the functions describedabove to a system or an apparatus and reading and executing the programcode stored in the storage medium by using a computer (centralprocessing unit (CPU) or microprocessing unit (MPU)) of the system orapparatus. In this case, the program code read from the storage mediumimplements the functions of the embodiments described above, and thestorage medium storing this program code may constitute an embodiment ofthe present invention.

The storage medium for providing the program code may be implemented by,for example, a flexible disk, a hard disk, an optical disk, amagneto-optical disk, a compact disc read-only memory (CD-ROM), acompact disk recordable (CD-R), a magnetic tape, a non-volatile memorycard, a ROM, a digital versatile disk (DVD), or the like.

Furthermore, in addition to the functions described above beingimplemented by executing the program code read by the computer, thefunctions described above may also be implemented by an operating system(OS) operating on the computer by performing some or all the actualprocesses in accordance with the instruction of the program code.

Furthermore, the program read from the storage medium may be written ina memory provided in a function expansion board placed in the computeror a function expansion unit connected to the computer. Then, the CPUprovided in the function expansion board or function expansion unit mayperform some or all the actual processes in accordance with theinstruction of the program code to implement the functions describedabove.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

The invention claimed is:
 1. A communication device configured toperform a communication parameter setting process as a providing deviceconfigured to provide a communication parameter or a receiving deviceconfigured to receive the communication parameter provided by theproviding device, the communication device comprising: one or moreprocessors; and a memory having stored thereon instructions which, whenexecuted by the one or more processors, cause the communication deviceto: search for another communication device; set a role of thecommunication device based on the following: (i) in a case where theanother communication device is searched for, a role of thecommunication device is set to the providing device or the receivingdevice using first information transmitted from the anothercommunication device as a response signal to a predetermined requestsignal and second information stored in the communication device, and(ii) in a case where the communication device receives third informationdifferent from the first information and transmitted from a deviceoperating as a providing device as a signal different from the responsesignal to the predetermined request signal, a role of the communicationdevice is set to the receiving device without using the secondinformation when the communication device performs the communicationparameter setting process with the device operating as the providingdevice; and transmit the third information in a case where a role of thecommunication device is set to the providing device using the firstinformation and the second information.
 2. The communication deviceaccording to claim 1, wherein the instructions, when executed by the oneor more processors, further cause the communication device to connect toa receiving device that receives the communication parameter using thecommunication parameter after the communication device provides thecommunication parameter as the providing device.
 3. The communicationdevice according to claim 1, wherein the communication device performswireless communication with the another communication device based onthe communication parameter.
 4. The communication device according toclaim 3, wherein the wireless communication is IEEE 802.11 compatiblewireless LAN communication.
 5. The communication device according toclaim 1, wherein the communication parameter includes at least one of anetwork identifier, an encryption method, an encryption key, anauthentication method and an authentication key.
 6. The communicationdevice according to claim 1, wherein the first information indicates arole of the another communication device.
 7. The communication deviceaccording to claim 1, wherein the second information is a communicationparameter set in the communication device.
 8. A method of controlling acommunication device configured to perform a communication parametersetting process as a providing device configured to provide acommunication parameter or a receiving device configured to receive thecommunication parameter provided by the providing device, the methodcomprising: searching for another communication device; setting a roleof the communication device based on the following: (i) in a case wherethe another communication device is searched for, setting a role of thecommunication device to the providing device or the receiving deviceusing first information transmitted from the another communicationdevice as a response signal to a predetermined request signal and secondinformation stored in the communication device, and (ii) in a case wherethe communication device receives third information different from thefirst information and transmitted from a device operating as a providingdevice as a signal different from the response signal to thepredetermined request signal, setting a role of the communication deviceto the receiving device without using the second information when thecommunication device performs the communication parameter settingprocess with the device operating as the providing device; andtransmitting the third information in a case where the role of thecommunication device is set to the providing device using the firstinformation and the second information.
 9. A non-transitorycomputer-readable medium storing a program for causing a computer tofunction as a communication device configured to perform a communicationparameter setting process as a providing device configured to provide acommunication parameter or a receiving device configured to receive thecommunication parameter provided by the providing device, wherein theprogram, when executed by the computer, causes the computer to: searchfor another communication device; set a role of the communication devicebased on the following: (i) in a case where the another communicationdevice is searched for, a role of the communication device is set to theproviding device or the receiving device using first informationtransmitted from the another communication device as a response signalto a predetermined request signal and second information stored in thecommunication device, and (ii) in a case where the communication devicereceives third information different from the first information andtransmitted from a device operating as a providing device as a signaldifferent from the response signal to the predetermined request signal,a role of the communication device is set to the receiving devicewithout using the second information when the communication deviceperforms the communication parameter setting process with the deviceoperating as the providing device; and transmit the third information ina case where a role of the communication device is set to the providingdevice using the first information and the second information.